<template style="height:100vh;overflow: hidden;">
	<view>
		<view class="top">
			<view class="title">核销操作</view>

		</view>

		<view class="content">
			<div class="verification-container">
				<view style="text-align: center;font-size: 18px;height: 40px;">
					核销码 MC1234-5678-9012
				</view>
				<view style="height: 4px;background-color: #e3e3e366;"></view>
				<p style="font-size: 18px;margin: 18px 0;">服务内容</p>
				<div class="service-content">
					<p>XXX标准洗车服务包含</p>
					<p>整车泡沫冲洗擦T</p>
					<p>轮胎轮毂冲洗清洁</p>
					<p>车内吸尘</p>
					<p>内饰脚垫简单除尘</p>
					<p>(不包含虫户、水泥、沥青和顽固污渍清理等)</p>
				</div>
				<view style="height: 4px;background-color: #e3e3e366;"></view>
				<div class="order-info">
					<p style="font-size: 18px;margin: 18px 0;">订单信息</p>
					<p>订单价格: ¥ 30.00</p>
					<p>实付金额: ¥ 25.00</p>
					<p>优忠金额: ¥ 5.00</p>
					<p>订单编号 2020032554565799</p>
					<p>支付时间 2020.03.30 14:40:45</p>
					<p>预约时间 2020.03.30 14:40</p>
				</div>
			</div>
		</view>
		<button class="confirm-button" @click="showPopup = !Sure" :disabled="Sure"
			:class="{'confirm-button-disabled':Sure}">
			{{Sure? '已核销' : '确认核销'}}
		</button>
		<view v-if="showPopup" class="popup">
			<view class="popup-content"> <text class="popup-title">确认核销</text></br>
				<text>核销此订单</text>
				<text class="popup-message">请您仔细核对订单,此操作不可撤销 </text></br>
				<text class="popup-message">请谨慎操作!</text>
				<view class="popup-buttons">
					<button @click="showPopup = false" class="popup-cancel">取消</button>
					<button @click="verifyOrder" class="popup-confirm">确定</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showPopup: false,
				Sure: false,
			}
		},
		methods: {
			verifyOrder() { // 在这里添加核销逻辑 
				this.Sure = true;
				this.showPopup = false;
				uni.showToast({
					title: '已确认到场',
					icon: 'success',
					duration: 2000
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.confirm-button {
		background-color: #007aff;
		color: #fff;
		border: none;
		border-radius: 4px;
		text-align: center;
		width: 80%;
		height: 50px;
	}

	.confirm-button-disabled {
		background-color: #cccccc !important;
		cursor: not-allowed;
		opacity: 0.8;
	}

	.top {
		height: 300rpx;
		width: 100%;
		background-color: #3385fd;
		padding-top: 30px;
	}

	.title {
		width: 100%;
		color: #fff;
		font-size: 33rpx;
		text-align: center;
	}

	.bg {
		width: 100%;
		background-color: #3183FB;
		height: 172px;
	}

	.content {
		position: relative;
		top: -152px;
		left: 22.5rpx;
		border-radius: 20px;
		width: 94%;
		background-color: white;
		padding: 28px 16px;
		box-sizing: border-box;
	}

	p {
		margin: 12px 0;
	}

	.popup {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 999;
		/* 添加较高的 z-index */
	}

	.popup-content {
		background-color: #fff;
		padding: 20px;
		border-radius: 10px;
		text-align: center;
		width: 80%;
		position: relative;

		z-index: 1000;

	}

	.popup-title {
		font-size: 20px;
		font-weight: bold;
		margin-bottom: 10px;
	}

	.popup-message {
		margin-bottom: 20px;
	}

	.popup-buttons {
		display: flex;
		justify-content: space-around;
	}

	.popup-confirm,
	.popup-cancel {

		background-color: #007aff;
		color: #fff;
		border: none;
		border-radius: 4px;
		height: 50px;
		width: 40%;
	}

	.popup-cancel {
		background-color: #ccc;
	}
</style>